/**
 * 
 */
package bai5.com.server;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

/**
 * @author nglehien Oct 21, 2012 - 9:19:26 PM
 */
public class RemoteEncode extends UnicastRemoteObject implements
		RemoteEncodeInterce {

	public static final String REVERSER_STRING = "REVERSER_STRING";
	private static final long serialVersionUID = 1L;

	public RemoteEncode() throws RemoteException {
		super();

	}

	@Override
	public String reverse(String input) {
		String[] words = input.split(" ");
		String output = new String();
		for (int j = 0; j < words.length; j++) {
			StringBuilder stringBuilder = new StringBuilder(words[j]);
			stringBuilder = stringBuilder.reverse();
			stringBuilder.append(" ");
			output += stringBuilder.toString();
		}
		return output;
	}

}
